import request from '@/utils/request'
/**
 * 获取企业列表
 * @param { page, pageSize} params
 * @returns
 */
// 获取企业列表
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}
// 获取行业列表
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}
// 上传文件 park/enterprise
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}
// 获取新增企业接口
export function createEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}
// /park/enterprise/{id}
// 获取回填数据
export function dataEnterpriseAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'GET'
  })
}
// 编辑企业
export function editEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// 删除企业
export function deleteEnterpriseAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'DELETE'
  })
}
// 查看企业详情
export function lookEnterpriseAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'GET'
  })
}
// 添加合同/park/enterprise/rent
export function addRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}
// 获取当前租赁合同
export function getRentlistAPI(id) {
  return request({
    url: '/park/enterprise/rent/' + id,
    method: 'GET'
  })
}
/**
 * 退租
 * @param {合同id} rentId
 * @returns
 */

export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/` + rentId,
    method: 'PUT'
  })
}
// 删除企业的租赁合同
export function deleteRentAPI(id) {
  return request({
    url: '/park/enterprise/rent/' + id,
    method: 'DELETE'
  })
}
